﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace common
{
    class JsHelp
    {
        public static string geta()
        {
            StringBuilder strTrans = new StringBuilder();
            strTrans.Append("var inputId = new Array();\n");
            strTrans.Append("    var a = window.document.getElementsByTagName('a');\n");
            //document.write(a.toString());
            strTrans.Append("    for (var i = 0; i < a.length; i++) {\n");
            //document.write(a[i]);
            strTrans.Append("        if (a[i] != null && a[i] != 'undefined') {\n");
            strTrans.Append("            inputId[i] = a[i];\n");
            strTrans.Append("        }\n");
            strTrans.Append("    }\n");
            //document.write(inputId.toString());
            strTrans.Append("    inputId.toString()\n");
            strTrans.Append("\n");
            string script = strTrans.ToString();
            //String[] checkboxIds = selenium.GetEval(script).Split(','); // Split the string.
            return script;

        }
    }
}
